import requests
import unittest

headers = {

    "Platform":"YXJKPT",
    "Identifier":"QJTYBS",
    "Content-Type": "application/json"

}
# res1 = requests.post(url="http://192.168.1.75:4010/controlagg/v1.0/Permission/GetVerifyCode",
#                      json={
#                          "global":
#                              {
#                             "os":2,
#                             "sign":"",
#                              "timestamp":0,
#                              "version":"",
#                              "imei":"",
#                              "dataSource":15,
#                              "langueType":1
#                              },
#                          "query":"70b18a30-0e1c-11ed-b822-f7f4e17066ae"},
#                      headers=headers)
#
# print(res1.json())
# print(res1.json().get("basis").get("msg"))

res2 = requests.post(url= "http://192.168.1.75:4010/controlagg/v1.0/Permission/Login",
                      json={"global":
                                {"os":2,
                                 "sign":"",
                                 "timestamp":0,
                                 "version":"",
                                 "imei":"",
                                 "dataSource":15,
                                 "langueType":1},
                            "query":{"account": "xkadmin",
                                     "pwd":"670B14728AD9902AECBA32E22FA4F6BD",
                                     "code":"6640",
                                     "codeKey":"70b18a30-0e1c-11ed-b822-f7f4e17066ae"}
                            },
                     headers=headers)

print(res2.json())
# print(res1.json().get("basis").get("msg"))